var nodeXlsx = require('node-xlsx');
var excelData = nodeXlsx.parse('./20160818/20160818.xlsx');
function getLength(str) {
    str = String(str);
    if (str.length <= 1) {
        str = '0' + str;
    }
    return str
}
var arr = [];
var l = excelData.length;
for (var i = 0; i < l; i++) {
    var ar = excelData[i].data;
    var ll = ar.length;
    for (var j = 1; j < ll; j++) {
        var aa = ar[j];
        var symbol = aa[1] == 'underfine' ? '' : aa[1];
        var now = new Date();
        var end = getLength(now.getMonth() + 1) + '/' + getLength(now.getDate()) + '/' + now.getFullYear();
        arr.push({
                etf_symbol: symbol,
                name: aa[2] == 'underfine' ? '' : aa[2],
                symbol: '.' + symbol,
                start: '01/01/2000',
                end: end,
                investingID: aa[8] == 'underfine' ? '' : aa[8]
            }
        );
    }
}
module.exports = arr;